public class HelloWorldTestClass {

	static testMethod void HelloWorldTest() {

		List<Position__c> positions = new List<Position__c>();
		ID userId = [select Id from user limit 1].Id;
		
		for (Integer i=0; i < 20; i++){
			Position__c p = new Position__c();
			p.Name = 'testName' + i;
			p.Job_Description__c = 'testDescription' + i;
			p.Hiring_manager__c = userId;
			positions.add(p);
		}
		
		//TODO: Wrap the following section in a try block
		try {

			System.debug('Attempting to insert positions');
			insert positions;
			System.debug('Insert complete');

			// refresh the Position list to include the Hello__c field after the insert
			
			//TODO: Create a position map to hold position IDs
			Map<ID, Position__c> posMap = new Map<ID, Position__c>(positions);


			//TODO: Write a SOQL statement to retrieve id, name and Hello_c into positions based on the IDs in the position map
			positions = [select Id, Name, hello__c from position__c where Id in :posMap.keySet()];
			

			//TODO: Write a loop to iterate through the positions object
			for (position__c pos : positions) {
				//TODO: Inside the loop: ensure position id is not null and hello field contains 'World' 
				//TODO: Inside the loop: write position id, name and Hello__c value to the debug log 
				System.assertEquals(pos.hello__c, 'World');
				System.assertNotEquals(pos.id, null);
				System.debug(pos.id + ' ' + pos.name + ' ' + pos.hello__c);	
			}

			
			
			//TODO: Wrap the following section in a catch block
		} catch (System.DMLException e) {
			System.debug('We caught a DML exception: ' + e.getDmlMessage(0));
		}	

		
	}
	
}